package jeconbond.experiment.natural.prodpossibfrontier.generate;

import jeconbond.economic.IEconomicEngine;
import jeconbond.economic.agent.IEconomicAgent;
import jeconbond.economic.agent.IEconomicProducer;
import jeconbond.economic.natural.agent.ProvideSingleResourceAgent;
import jeconbond.economic.systems.natural.NaturalResourceRedestributionSystem;
import jeconbond.experiment.natural.prodpossibfrontier.process.IConneryExperimentContext;
import jeconbond.experiment.natural.prodpossibfrontier.ConneryExperimentSettings;
import jeconbond.experiment.generate.IEngineInitialiser;
import laboratoryQ.experiment.process.IExperimentContext;

public class ProdPossibEngineInitialiser implements IEngineInitialiser {
	@Override
	public void initialise(
			IEconomicEngine engine, 
			IEconomicProducer[] agents,
			IExperimentContext iexperimentContext
	) {
		engine.addAgents(agents);
		IConneryExperimentContext experimentContext = 
			(IConneryExperimentContext) iexperimentContext;
		ConneryExperimentSettings settings = experimentContext.getExperimentSettings();
		IEconomicAgent metallurgy = new ProvideSingleResourceAgent(
				(NaturalResourceRedestributionSystem)experimentContext.getRRS(), 
				settings.ironResource, 
				settings.ironByStep
		);
		engine.addAgents(metallurgy);
		engine.addAgents(experimentContext.getServiceAgents());
	}
}
